package com.xucy.springboot.redis.PubSub;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author xucy
 * @Date 2019-07-04 14:15
 * @Description 发布者
 **/

@RestController
@RequestMapping("/pubCon")
public class PubController {

    @Autowired
    private StringRedisTemplate stringRedisTemplate;


    @RequestMapping("/pub")
    public String pub(){
        stringRedisTemplate.convertAndSend("pub","我是发布者");

        return "成功";
    }
}
